-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] Swap package dependency ruff for black and autoflake #757
Conversation
vizro-ai/changelog.d/20240930_141508_maximilian_schulz_swap_ruff_for_black.md
Show resolved
Hide resolved
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is our goal to replace ruff completely or just as a mkdocs requirement?
For example there are still some mentions of ruff and we use it e.g. for pydocstyle etc.
Does this not have to be replaced? Or is this fine because it's run via our pre-commit hook?
[tool.ruff]
line-length = 120
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 6
...
ruff was previous used in 2 places for Vizro-AI code string formatting:
This PR is mainly to drop the ruff use for these two. |
Got it! Can we add that to the PR description? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A sad but necessary change :(
Please could you give a quick example of how this output is different to what ruff gave before? I guess the fact that none of the unit tests were changed means it's exactly the same for all our example cases?
vizro-core/changelog.d/20240930_141041_maximilian_schulz_swap_ruff_for_black.md
Outdated
Show resolved
Hide resolved
…into tidy/swap_ruff_for_black
for more information, see https://pre-commit.ci
Yes, the magic of unit tests :) So in general not all code string would end up the same, as we are only formatting with black rules (and they may not 100% match - but seem to for the examples) and we only remove unused imports, and no other formats (which previously was the case for ruff but it looks like it was also unused) |
We are not removing our development dependency and tooling, but the package dependency. |
Description
Given our continued difficulties to make
ruff
run on WebAssembly, we decide to swap the usage of ruff via subprocess for using black and autoflake. Using ruff is still the preferred goal, but as long as there is no python API, as well as a WASM compiled version available, we will stick with the current solution.Note:
ruff was previous used in 2 places for Vizro-AI code string formatting:
inside vizro-ai plot
inside vizro-core pydantic to python (vizro models to python code) conversion.
This PR is mainly to drop the ruff use for these two.
Screenshot
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":